package com.xnfh.equipment.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseDataBindingHolder
import com.xnfh.common.bean.WarningBean
import com.xnfh.common.bean.WarningItem
import com.xnfh.equipment.R
import com.xnfh.equipment.databinding.ItemEquipmentWarningBinding

/**
 * @Description:
 * @Author: ziheng
 * @CreateDate: 2023/12/20 11:26
 * @UpdateUser: ziheng
 * @UpdateDate: 2023/12/20 11:26
 * @UpdateRemark: 更新说明
 */
class EquipmentWarningAdapter :
    BaseQuickAdapter<WarningItem, BaseDataBindingHolder<ItemEquipmentWarningBinding>>(
        R.layout.item_equipment_warning
    ) {
    override fun convert(
        holder: BaseDataBindingHolder<ItemEquipmentWarningBinding>,
        item: WarningItem
    ) {
        holder.setText(
            R.id.warning_name,
            "[${item.Gatewayname}${context.getString(R.string.str_warning)}]"
        )
        holder.setText(
            R.id.warning_time,
            context.getString(R.string.str_time) + item.Logtime.replace("T", " ").replace("Z", "")
        )
        holder.setText(R.id.warning_type,item.Logtxt)
    }
}